package com.szzg10.webservice.chapter1;

import java.net.MalformedURLException;
import java.net.URL;

import javax.xml.namespace.QName;
import javax.xml.ws.Service;

public class TimeClient {

	public static void main(String[] args) throws MalformedURLException {
		
		URL url = new URL("http://localhost:9876/ts");
		QName qName = new QName("http://chapter1.webservice.szzg10.com/", "TimeServerImplService");
		
		Service service = Service.create(url, qName);
		service.setHandlerResolver(new TimeClientHandlerResolver());
		
		TimeServer timeServer = service.getPort(TimeServer.class);
		System.out.println(timeServer.getTimeAsString());
		System.out.println(timeServer.getTimeAsElapsed());
	}
}
